@extends('layouts.public')

@section('bodyattr')class="gray-bg"@endsection

@section('body')
    <div class="wrapper wrapper-content">
        <div class="row m-b">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="{{route('admin.customer.customers')}}">客服列表</a></li>
                        <li><a href="{{route('admin.customer.customers.add')}}">新增</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                            <thead>
                            <tr role="row">
                                <th>客服ID</th>
                                <th>客服名称</th>
                                <th>客服昵称</th>
                                <th>微信号</th>
                                <th>微信二维码</th>
                                <th class="sorting" orderby="created_at">创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            @foreach($goods as $user)
                                <tr class="gradeA">
                                    <td>{{$user['id']}}</td>
                                    <td>{{$user['username']}}</td>
                                    <td>{{$user['nickname']}}</td>
                                    <td>{{$user['wx']}}</td>
                                    <td>
                                         <img src="{{ $user ['qrcode']}}" alt="">
                                    </td>

                                    <td>{{$user['created_at']}}</td>
                                   
                                    <td>

                                        <a href="{{route('admin.customer.customers.edit',[$user->id])}}">编辑</a>
                                        | <a class="ajaxBtn" href="javascript:void(0);" uri="{{route('admin.customer.customers.delete',[$user->id])}}" msg="是否删除该客服？">删除</a>
                                    </td>
                                </tr>
                            @endforeach
                        </table>
                        <div class="row">
                            <div class="col-sm-12">
                                <div>共 {{ $goods->total() }} 条记录</div>
                                {!! $goods->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('script')
    <script type="text/javascript" src="{{cdn('js/plugins/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        laydate.render({
            elem: '#created_at',
            range: true,
            max: 0
        });
    </script>
@endsection
